package com.kingzoder.food.common;


import lombok.Getter;

/**
 * @author 轩辕铮
 */
@Getter
public enum AppHttpCode {
    // 成功
    SUCCESS(200, "操作成功"),
    //错误
    ERROR(500, "错误"),
    TOKEN_EXPIRE(401, "您还未登录或登录失效，请重新登录"),
    ERROR_PARAM(403, "参数错误"),
    ACCESS_DENIED(400, "无权操作"),
    ACCESS_LIMIT(400, "请求过于频繁，请三十分钟后再操作！"),
    // 登录
    NEED_LOGIN(401, "需要登录后操作"),
    WAITING_AUDIT(400, "请耐心等待审核！🙂"),
    NEED_QQ_EMAIL(400, "目前只支持QQ邮箱登录！"),
    NOT_FOUNT_QQ_EMAIL(400, "该邮箱并未注册用户！"),
    REQUIRE_USERNAME_OR_EMAIL(400, "请用用户名或邮箱登录"),
    CODE_EXPIRED(400, "验证码错误或已过期"),
    NO_OPERATOR_AUTH(403, "无权限操作"),
    SYSTEM_ERROR(500, "系统繁忙"),
    USERNAME_EXIST(500, "用户名已经被使用"),
    NICKNAME_EXIST(500, "昵称已经被使用"),
    EMAIL_EXIST(500, "邮箱已经被使用"),
    PHONE_EXIST(502, "手机号已存在"),
    LOGIN_ERROR(505, "用户名或密码错误"),
    FILE_TYPE_ERROR(500, "文件类型不正确"),
    NO_HAVA_ID(500, "已从系统中删除"),
    ROLE_HAS_USER(500, "还有用户属于该角色,不能删除"),
    MENU_HAVA_CHILD(500, "存在子菜单不允许删除"),
    MENU_PARENT_UNLOGICAL(500, "修改菜单失败，上级菜单不能选择自己"),

    COMMENT_NOT_EXIT(500, "评论内容不能为空"),
    HAVE_ARTICLE_CATEGORY(500, "该分类已被文章使用无法删除！"),
    HAVE_ARTICLE_TAG(500, "该标签已被文章使用无法删除！"),
    PHOTO_UPLOAD_ERROR(5000, "系统图片功能正在升级....");

    final int code;
    final String message;

    AppHttpCode(int code, String errorMessage) {
        this.code = code;
        this.message = errorMessage;
    }

}
